import openpyxl
from config.config import EXCEL_FILE,SHEETNAME

def read_excel(filename=EXCEL_FILE,sheetname=SHEETNAME):
    workbook = openpyxl.load_workbook(filename+".xlsx")
    worksheet=workbook[sheetname]
    data=[]
    keys=[cell.value for cell in worksheet[3]]
    for value in worksheet.iter_rows(min_row=4,values_only=True):
        dict_data=dict(zip(keys,value))
        if dict_data["is_ture"]:
            data.append(dict_data)
    workbook.close()
    return data